<a href="/personal/topup"><div class="topBack"><img src="/images/back_jiantou.png" style="width:40px;height:40px;"></div></a>
<div class="topContent">余额明细</div>
<div class="topRight">&nbsp;</div>
<div class="clear"></div>

<div id="wrapperTopupDetail" class="wrapperComman" style="top:40px;bottom:0px;">
<div style="width:100%;">

<div style="width:20%;height:80px;float:left;text-align:center;"><img src="/images/topupyuan.png" style="width:70px;height:70px;"></div>
<div style="width:50%;height:80px;float:left;padding:15px 0px;">
	<p style="color:grey;font-size:0.9em;">当前余额</p>
	<p style="font-size:0.8em;color:grey;"><span id="totalCredit" style="color:red;font-size:1.4em;font-weight:bolder;"><?php if(!empty($this->res_info->User)){echo $this->res_info->User->balance;}else{echo 0;}?></span>元</p>
</div>
<div class="clear"></div>
<div class="beijin"></div>

<?php 
if(empty($this->res)){
	echo '<div style="text-align:center;"><img src="/images/none.jpg" style="width:50%;padding-top:110px;"></div>';
	echo '<div style="text-align:center;padding:30px 0px;font-size:0.9em;">亲，暂无余额记录，赶紧去<a href="/personal/topup" style="color:red;">充值</a>吧！</div>';
}else{
	echo '<div style="padding:5px 10px;font-size:0.9em;">余额明细</div>
		<div class="clear" style="border-bottom:1px solid #EAEAEA;"></div>
	';
	// var_dump($this->res);
	foreach($this->res as $r){
		echo '
		<div style="float:left;width:55%;font-size:0.95em;padding:5px 10px;">
		<div style="color:#4B4B4B;">'.$r->title.' <span style="font-size:0.8em;color:red;">';
		if($r->type==2)echo '('.$r->ordercode.')';
		echo '</span></div>
		<div style="font-size:0.8em;color:#A4A4A4;">'.$r->inserttime.'</div>
		</div>';
		echo '<div style="float:left;width:20%;font-size:0.8em;padding:15px 0px 0px 0px;">';
		if($r->type==1){
			if($r->has_paid == 1){
				echo '<span style="color:red;">成功</span>';
			}else{
				echo '失败';
			}
		}else{
			if($r->status ==2){
				echo '<span style="color:red;">成功</span>';
			}else{
				echo '失败';
			}
		}
		echo '</div>';
		if($r->type==1){
		echo '<div style="float:left;width:25%;text-align:center;padding:12px 0px;color:red;">+'.$r->amount;
		if($r->present>0)echo '(赠'.$r->present.')';
		echo ' </div>';
		}else if($r->type==4){
			echo '<div style="float:left;width:25%;text-align:center;padding:12px 0px;color:red;">+'.$r->expenditure.'</div>';
		}else{
			echo '<div style="float:left;width:25%;text-align:center;padding:12px 0px;">-'.$r->expenditure.'</div>';
		}
		echo '
		<div class="clear" style="border-bottom:1px solid #EAEAEA;"></div>
		';
	}
}
?>


</div>
</div>

<script type="text/javascript">
	var myscroll='';
	$(document).ready(function() {
        function loaded(){
           setTimeout(function(){
                    myscroll=new iScroll("wrapperTopupDetail");
             },100 );
        }
		loaded();
	});
	
</script>